
package ch.hearc.meteo.imp.afficheur.real;

import ch.hearc.meteo.imp.afficheur.real.moo.StationMeteoElement;
import ch.hearc.meteo.spec.afficheur.AfficheurService_I;
import ch.hearc.meteo.spec.meteo.MeteoServiceOptions;
import ch.hearc.meteo.spec.meteo.listener.event.MeteoEvent;

public class AfficheurService implements AfficheurService_I
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	public AfficheurService(StationMeteoElement stationMeteoElement)
		{
		this.stationMeteoElement = stationMeteoElement;
		this.stationMeteoElement.setAfficheurService(this);
		this.meteoServiceOptions = new MeteoServiceOptions(MeteoServiceOptions.DEFAULT_DT, MeteoServiceOptions.DEFAULT_DT, MeteoServiceOptions.DEFAULT_DT);
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	@Override
	public void printPression(MeteoEvent event)
		{
		stationMeteoElement.printPression(event);
		}

	@Override
	public void printAltitude(MeteoEvent event)
		{
		stationMeteoElement.printAltitude(event);
		}

	@Override
	public void printTemperature(MeteoEvent event)
		{
		stationMeteoElement.printTemperature(event);
		}

	@Override
	public void disconnect()
		{
		JFrameStationMeteo.getInstance().removeMeteoServiceWrapper(stationMeteoElement.getMeteoService(), this);
		}

	/*------------------------------*\
	|*				Set				*|
	\*------------------------------*/

	@Override
	public void setMeteoServiceOptions(MeteoServiceOptions meteoServiceOptions)
		{
		this.meteoServiceOptions = meteoServiceOptions;

		}

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/

	@Override
	public MeteoServiceOptions getMeteoServiceOptions()
		{
		return this.meteoServiceOptions;
		}

	public StationMeteoElement getStationMeteoElement()
		{
		return this.stationMeteoElement;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/

	private StationMeteoElement stationMeteoElement;
	private MeteoServiceOptions meteoServiceOptions;

	}
